<template lang="">
    <div>
        <input v-model="phone" />
        <div>
            <button @click="getData">请求</button>
            <button @click="findPhone">查询手机号</button>
        </div>
        <ul>
            <li v-for="(item, index) in arr" :key="index">
                {{ item.title }}
            </li>
        </ul>
    </div>
</template>
<script>
import { getDouyin } from '@/api/xinwen'
import { getShouji } from '@/api/ip'
export default {
    data() {
        return {
            arr: [],
            phone: ''
        }
    },
    methods: {
        getData() {
            getDouyin().then(data => {
                this.arr = data.data
            })
        },
        findPhone() {
            if (!this.phone) return alert('请输入手机号')
            getShouji(this.phone).then(res => {
                console.log(res);
            })
        }
    }
}
</script>
<style lang="">
    
</style>